import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { CronService } from './modules/cron/cron.service';

async function boot() {
  const PORT = process.env.PORT ?? 1111;
  const app = await NestFactory.create(AppModule, { cors: true });
  app.setGlobalPrefix('api');
  await app.listen(PORT);

  const cronService = app.get(CronService);
  cronService.startCronSync();
}
boot();
